package com.unb.transportebsb;

import java.util.List;

import com.unb.webservice.Postgis;

public class ReportColumns {

    private String columnOne;
    private String columnTwo;
    private String columnThree;
    private double longitude;
    private double latitude;

    public double getLongitude() {
        return longitude;
    }

    public void setLongitude(double longitude) {
        this.longitude = longitude;
    }

    public double getLatitude() {
        return latitude;
    }

    public void setLatitude(double latitude) {
        this.latitude = latitude;
    }

    public ReportColumns(String columnOne, String columnTwo, String columnThree, double longitude, double latitude) {
        super();
        this.columnOne = columnOne;
        this.columnTwo = columnTwo;
        this.columnThree = columnThree;
        this.longitude = longitude;
        this.latitude = latitude;
    }

    public String getColumnOne() {
        return columnOne;
    }

    public void setColumnOne(String columnOne) {
        this.columnOne = columnOne;
    }

    public String getColumnTwo() {
        return columnTwo;
    }

    public void setColumnTwo(String columnTwo) {
        this.columnTwo = columnTwo;
    }

    public String getColumnThree() {
        return columnThree;
    }

    public void setColumnThree(String columnThree) {
        this.columnThree = columnThree;
    }

    public static List<ReportColumns> makeData(double longParada, double latParada) {
        // List<ReportColumns> pair = new ArrayList<ReportColumns>();
        List<ReportColumns> result = new Postgis().qryLinhasParadaPosicao(longParada, latParada);
        for (int i = 0; i < result.size(); i++) {
            String tempo = new Postgis().qryTempo(Integer.parseInt(result.get(i).columnOne), result.get(i).longitude,
                    result.get(i).latitude, longParada, latParada);
            result.get(i).setColumnThree(tempo);
        }
        // for (int i = 0; i < result.size(); i++) {
        // pair.add(new ReportColumns(Integer.toString(i), "Col 2 value " +
        // Integer.toString(i), "x"));
        // }
        return result;
    }
}